<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <ui:composition template="Template.xhtml">
        <ui:define name="top">
            发送消息</ui:define>
        <ui:define name="content">
            <f:event listener="#{messageCreateMB.precreateMsg()}"
                     type="preRenderView"></f:event>
             
                    <h:form id="form" style="height: 100%">
                    <h:outputScript library="js" name="map/inputAutocomplete.js"/>
                    <p:panel>


                        <p:panelGrid styleClass="noborder left" columns="2"   >


                            <h:outputText value="收信范围" />
                            <p:selectOneMenu id="messagerange" value="#{messageCreateMB.messageRange}" >
                                <f:selectItem itemLabel="单点" itemValue="user" />
                                <f:selectItem itemLabel="群发" itemValue="role" />
                                <p:ajax event="change"  update="messagerange" />
                            </p:selectOneMenu>
                            <h:outputText value="收信人/角色" />
                            <p:autoComplete id="msgfor" value="#{messageCreateMB.forid}" itemValue="#{item.k}" itemLabel="#{item.v}" var="item" completeMethod="#{messageCreateMB.completeText}" />
                            <h:outputText value="内容" />
                            <p:inputTextarea rows="6" cols="33" value="#{messageCreateMB.msg.msg}"/>


                        </p:panelGrid>
                        <p:panelGrid styleClass="noborder left"  style="width:100% " columns="1"   >

                            <p:commandButton value="#{bundle.conform}" validateClient="true" action="#{messageCreateMB.create()}"  update="growl">
                                <p:confirm header="#{bundle.conform}" message="#{bundle.conform}" icon="ui-icon-alert" />
                            </p:commandButton>
                            <p:button value="#{bundle.back}" onclick="history.back()">

                            </p:button>
                        </p:panelGrid>
                        <p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
                            <p:commandButton value="#{bundle.yes}" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                            <p:commandButton value="#{bundle.no}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
                        </p:confirmDialog>
                    </p:panel>
                </h:form>





                <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;" address=""></div>
                <!--</shiro:hasPermission>-->
        </ui:define>
    </ui:composition>
</html>

